@extends('admin.layout')

@section('title')栏目管理@endsection



@section('content')
    <div class="page clearfix">

        <ol class="breadcrumb breadcrumb-small">
            <li>后台首页</li>
            <li><a href="{{ url('admin/categroys') }}">栏目管理</a></li>
            <li><a href="{{ url('admin/categroys/create') }}">栏目添加</a></li>
        </ol>

        <div class="page-wrap">

            <div class="row">
                <div class="col-md-12">
                    <form action="{{ url('admin/categroys/'.$cate['id']) }}" autocomplete="off" class="form-horizontal" method="post">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
                        <input type="hidden" name="_method" value="PUT">
                        <div class="panel panel-lined clearfix mb30">
                            <div class="panel-heading mb20"><i>添加栏目</i></div>
                            <div class="col-md-12">



                                <div class="form-group form-group-sm">
                                    <label class="col-md-4 control-label">上级栏目</label>
                                    <div class="col-md-4">
                                        <select class="form-control areaSelect" name="pid">
                                            <option value="0">无上级栏目</option>
                                            @if( $parent )
                                                @foreach($parent as $item)
                                                    <option value="{{ $item['id'] }}" @if($item['id'] == $cate['pid']) selected @endif>{{ $item['_name'] }}</option>
                                                @endforeach
                                            @endif
                                        </select>
                                    </div>
                                </div>




                                <div class="form-group form-group-sm">
                                    <label class="col-md-4 control-label">栏目名称</label>
                                    <div class="col-md-4">
                                        <input type="text" class="form-control" name="name" value="{{ $cate['name'] }}">
                                    </div>
                                </div>


                                <div class="form-group form-group-sm">
                                    <label class="col-md-4 control-label">是否私有</label>
                                    <div class="col-md-4">
                                        <div class="btn-group" data-toggle="buttons">
                                            <label class="btn btn-primary @if($cate['private'] == 1) active @endif">
                                                <input type="radio" name="private" @if($cate['private'] == 1) checked @endif value="1" id="option2" autocomplete="off"> 私有
                                            </label>
                                            <label class="btn btn-primary @if($cate['private'] == 0) active @endif">
                                                <input type="radio" name="private" @if($cate['private'] == 0) checked @endif value="0" id="option3" autocomplete="off"> 公开
                                            </label>
                                        </div>
                                    </div>
                                </div>






                                <div class="form-group form-group-sm">
                                    <div class="col-md-4 col-md-offset-4">
                                        <button type="submit" class="btn btn-primary btn-sm" style="width: 100%;">提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
@endsection
